home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_comcontrol.cog < prev    next >
Text File  |  1999-11-15  |  8KB  |  272 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_ComControl.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     user0
  14.     message     user1
  15.     message     user2
  16.     message     entered
  17.     message     killed
  18.     
  19.     # ** Switch4 and Switch5 Commies **
  20.     thing       s4_com1
  21.     thing       s4_com2
  22.     thing       s5_com1
  23.     thing       s5_com2
  24.     thing       s5_com3
  25.     thing       s5_com4     # hard grenade com
  26.     
  27.     # ** control room commies **
  28.     thing       ctrlCom1
  29.     thing       ctrlCom2
  30.     thing       ctrlCom3
  31.     thing       ctrlCom4
  32.     thing       ctrlCom_Grenade
  33.     
  34.     # ** control room items **
  35.     thing       ctrl_Grenades
  36.     
  37.     # ** control room second wave **
  38.     thing       ctrlCom5
  39.     thing       ctrlCom6
  40.     
  41.     # ** oil shed second wave **
  42.     thing       shed_Grenade2
  43.     thing       shed_Machine1
  44.     
  45.     # ** exit comp second wave **
  46.     thing       exit_Bruiser
  47.     thing       exit_Machine1
  48.     
  49.     # ** explosion positions **
  50.     thing       shed_Exp1
  51.     thing       shed_Exp2
  52.     
  53.     # ** surfaces **
  54.     surface     switch2
  55.     surface     switch3
  56.     surface     surf_ExpTrig1
  57.     surface     surf_ExpTrig2
  58.     surface     surf_Berserk1
  59.     
  60.     # ** templates **
  61.     template    tpl_Explode=+dummy_bazooka      local
  62.     
  63.     # ** types **
  64.     AI            ai_sniper=com_2Hsniper.ai        local
  65.     
  66.     int         theyre_Here=0       local
  67.     int         dif_Level           local
  68.     int         shed_LowRoad=0      local
  69.     int         shed_Berserker=0    local
  70.     
  71. end
  72.  
  73. # ========================================================================================
  74.  
  75. code
  76.  
  77. startup:
  78.  
  79.     # hide switch4 and switch5 commies
  80.     SetThingFlags(s4_com1, 0x80000);
  81.     SetThingFlags(s4_com2, 0x80000);
  82.     SetThingFlags(s5_com1, 0x80000);
  83.     SetThingFlags(s5_com2, 0x80000);
  84.     SetThingFlags(s5_com3, 0x80000);
  85.     SetThingFlags(s5_com4, 0x80000);
  86.     
  87.     # hide control room commies
  88.     SetThingFlags(ctrlCom1, 0x80000);
  89.     SetThingFlags(ctrlCom2, 0x80000);
  90.     SetThingFlags(ctrlCom3, 0x80000);
  91.     SetThingFlags(ctrlCom4, 0x80000);
  92.     SetThingFlags(ctrlCom5, 0x80000);
  93.     SetThingFlags(ctrlCom6, 0x80000);
  94.     SetThingFlags(ctrlCom_Grenade, 0x80000);
  95.     SetThingFlags(ctrl_Grenades, 0x80000);      # inv grenades
  96.     
  97.     # hide shed commies
  98.     SetThingFlags(shed_Machine1, 0x80000);
  99.     SetThingFlags(shed_Grenade2, 0x80000);
  100.     
  101.     # hide exit comp commies
  102.     SetThingFlags(exit_Machine1, 0x80000);
  103.     SetThingFlags(exit_Bruiser, 0x80000);
  104.  
  105.     return;
  106.  
  107. # ========================================================================================
  108.  
  109. user0:
  110.  
  111.     dif_Level = GetDifficulty();
  112.     Sleep(0.1);
  113.     
  114.     # message sent by chase cogs
  115.     if(theyre_Here == 0)
  116.     {
  117.         theyre_Here = 1;
  118.         # show switch4 and switch5 commies
  119.         ClearThingFlags(s4_com1, 0x80000);
  120.         ClearThingFlags(s4_com2, 0x80000);  # simonov sniper
  121.         ClearThingFlags(s5_com1, 0x80000);
  122.         ClearThingFlags(s5_com2, 0x80000);
  123.         ClearThingFlags(s5_com3, 0x80000);
  124.         
  125.         if(dif_Level == 5)
  126.         {
  127.             ClearThingFlags(s5_com4, 0x80000);  # grenade com
  128.             AISetClass(s5_com4, ai_sniper);
  129.         }
  130.         
  131.         # turn s5_com2 into a sniper
  132.         AISetClass(s5_com2, ai_sniper);
  133.     }
  134.     
  135.     UpdateDifficulty(dif_Level);
  136.     
  137.     return;
  138.  
  139. # ========================================================================================
  140.  
  141. user1:
  142.  
  143.     # message sent by comEntrance
  144.     dif_Level = GetDifficulty();
  145.     Sleep(0.1);
  146.     
  147.     # show control room commies
  148.     ClearThingFlags(ctrlCom1, 0x80000);
  149.     ClearThingFlags(ctrlCom3, 0x80000);
  150.     ClearThingFlags(ctrlCom4, 0x80000);     # bruiser
  151.     
  152.     if(dif_Level >= 3)
  153.     {
  154.         ClearThingFlags(ctrlCom2, 0x80000);
  155.     }
  156.     
  157.     if(dif_Level == 5)
  158.     {
  159.         ClearThingFlags(ctrlCom_Grenade, 0x80000);     # grenade
  160.         AISetClass(ctrlCom_Grenade, ai_sniper);
  161.         ClearThingFlags(ctrl_Grenades, 0x80000);        # inv grenades
  162.     }
  163.     
  164.     AISetMaxHomeDist(ctrlCom3, 0.5);
  165.     
  166.     UpdateDifficulty(dif_Level);
  167.     
  168.     return;
  169.  
  170. # ========================================================================================
  171.  
  172. user2:
  173.  
  174.     # message received when player oils switch4
  175.     dif_Level = GetDifficulty();
  176.     Sleep(0.1);
  177.     
  178. # ************************
  179. # ** ctrlRm second wave **
  180. # ************************
  181.     if(ctrlCom3 == -1)
  182.     {
  183.         ClearThingFlags(ctrlCom5, 0x80000);     # simonov on upper track
  184.         AISetMaxHomeDist(ctrlCom5, 0.4);
  185.     }
  186.     
  187.     if((ctrlCom4 == -1) && (dif_Level >= 3))
  188.     {
  189.         ClearThingFlags(ctrlCom6, 0x80000);     # shotgun in doorway
  190.         AISetMaxHomeDist(ctrlCom6, 0.1);
  191.     }
  192.     
  193. # *************************
  194. # ** OilShed second wave **
  195. # *************************
  196.     # player is taking low road back to ctrl room
  197.     if((GetWallCel(switch2) == 1) && (GetWallCel(switch3) == 2))
  198.     {
  199.         shed_LowRoad = 1;
  200.         ClearThingFlags(shed_Grenade2, 0x80000);     # grenade
  201.         AISetClass(shed_Grenade2, ai_sniper);
  202.     }
  203.     
  204.     else if(GetWallCel(switch2) == 2)
  205.     {
  206.         shed_LowRoad = 1;
  207.         ClearThingFlags(shed_Grenade2, 0x80000);     # grenade
  208.         AISetClass(shed_Grenade2, ai_sniper);
  209.     }
  210.     
  211.     # player is taking high road back to ctrl room
  212.     else if((GetWallCel(switch2) == 1) && (GetWallCel(switch3) == 1))
  213.     {
  214.         shed_Berserker = 1;
  215.         ClearThingFlags(shed_Machine1, 0x80000);     # machine gun com on track
  216.         AISetAllowedSurfaceType(shed_Machine1, 0x4000);
  217.     }
  218.     
  219. # ***************************
  220. # ** Exit comp second wave **
  221. # ***************************
  222.     if(dif_Level >= 4)
  223.     {
  224.         ClearThingFlags(exit_Bruiser, 0x80000);     # bruiser in doorway
  225.     }
  226.     
  227.     ClearThingFlags(exit_Machine1, 0x80000);     # machine gun
  228.     
  229.     UpdateDifficulty(dif_Level);
  230.     
  231.     return;
  232.  
  233. # ========================================================================================
  234.  
  235. entered:
  236.  
  237.     if((GetSenderRef() == surf_ExpTrig1) && (shed_LowRoad == 1) && (shed_Grenade2 != -1))
  238.     {
  239.         CreateThing(tpl_Explode, shed_Exp1);
  240.     }
  241.     
  242.     if((GetSenderRef() == surf_ExpTrig2) && (shed_LowRoad == 1) && (shed_Grenade2 != -1))
  243.     {
  244.         CreateThing(tpl_Explode, shed_Exp2);
  245.     }
  246.     
  247.     if((GetSenderRef() == surf_Berserk1) && (shed_Berserker == 1))
  248.     {
  249.         shed_Berserker = 0;
  250.         AISetMode(shed_Machine1, 0x100000);
  251.     }
  252.  
  253.     return;
  254.  
  255. # ========================================================================================
  256.  
  257. killed:
  258.  
  259.     if(GetSenderRef() == ctrlCom1) ctrlCom1 = -1;   # shotgun upper track
  260.     if(GetSenderRef() == ctrlCom2) ctrlCom2 = -1;   # machine gun near stairs
  261.     if(GetSenderRef() == ctrlCom3) ctrlCom3 = -1;   # simonov w/max home dist
  262.     if(GetSenderRef() == ctrlCom4) ctrlCom4 = -1;   # bruiser in ctrl room
  263.     if(GetSenderRef() == shed_Grenade2) shed_Grenade2 = -1;   # grenade in oil shed
  264.     if(GetSenderRef() == shed_Machine1) shed_Machine1 = -1;   # oil shed berserker
  265.  
  266.     return;
  267.  
  268. # ========================================================================================
  269.  
  270. end
  271.  
  272.